package com.genius.service.impl;

import com.genius.file.pojo.File;
import com.genius.mapper.FileMapper;
import com.genius.service.FileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Slf4j
@Service
public class FileServiceImpl implements FileService {

    @Autowired
    private FileMapper fileMapper;

    @Override
    public File selectFileById(Long fileId) {
        return fileMapper.selectFileById(fileId);
    }

    @Override
    public List<File> selectFileByPage(File file) {
        return fileMapper.selectFileByPage(file);
    }

    @Override
    @Transactional
    public int insertFile(File file) {
        return fileMapper.insertFile(file);
    }

    @Override
    @Transactional
    public int unDeleteFileByIds(Long[] ids) {
        return fileMapper.unDeleteFileByIds(ids);
    }

    @Override
    @Transactional
    public int deleteFileByIds(Long[] ids) {
        return fileMapper.deleteFileByIds(ids);
    }
}
